<template>
  <uni-datetime-picker type="date" hide-second @change="handleChange">
    <div class="form-item">
      <div class="label">
        {{ label }}
      </div>
      <div class="content">
        <div v-if="!value" class="placeholder">
          {{ placeholder }}
        </div>
        <div v-else>
          {{ value }}
        </div>
        <van-icon name="arrow" />
        <!-- <image class="arrow-right" src="@/static/icons/arrow-right.png" /> -->
      </div>
    </div>
  </uni-datetime-picker>
</template>

<script>

export default {
  name: 'ZeDatetime',
  components: { },
  props: {
    label: { type: String, default: '' },
    placeholder: { type: String, default: '请选择' },
    value: {},
  },
  methods: {
    handleChange(v) {
      this.$emit('input', v)
    },
  },
}
</script>

  <style lang="scss" scoped>
  .arrow-right {
    display: inline-block;
    vertical-align: middle;
    width: 16px;
    height: 16px;
  }
  .form-item {
    font-size: 14px;
    font-weight: 400;
    line-height: 14px;
    padding: 15px 0;
    display: flex;
    justify-content: space-between;

    .label {
      color: #333333;
      font-size: 14px;
    }

    .content {
      font-size: 14px;
      display: flex;
      align-items: center;
      column-gap: 5px;
    }

    .placeholder {
      color: #999999;
    }
  }
  </style>
